--[[
编码: JX-800-03
名称: 入库任务列表
作者:HAN
日期:2025-1-29
级别: 固定 (说明本段代码在项目中不太会变化)
函数: GenerateViewHTML
功能:
统计作业各种状态的数量(测试一下用)
更改记录:
--]]
json = require ("json")
mobox = require ("OILua_JavelinExt")
m3 = require("oi_base_mobox")
function GetHtmlStyle()
return ''
end
function GenerateViewHTML(strLuaDEID)
local nRet, strRetInfo
local strHtmlTitle = "";
local strHtmlRow = "";
--[[ 获取样式 ]]
local strHtmlStyle = GetHtmlStyle();
--[[ 列明 ]]
local tabTitleList = {"作业编码", "起点", "终点"}
--[[ 组织列名 ]]
--[[ class 处理样式 这里 组成(table-col' .. i .. ') table-col1,table-col2,table-col3 ]]
for i = 1, #tabTitleList do
strHtmlTitle = strHtmlTitle .. '
' .. tabTitleList[i] .. '
'
end
--[[ 数据 ]]
local tabDataList = {
{
code = "OP2402-0120",
qd = "K2-122-131",
zd = "K2-122-135",
back = "#2196F3"
},
{
code = "OP2402-0112",
qd = "K2-122-132",
zd = "K2-122-136",
back = "#ff5722"
},
{
code = "OP2402-0020",
qd = "K2-122-133",
zd = "K2-122-137",
back = "#ffc107"
},
{
code = "OP2402-0110",
qd = "K2-122-134",
zd = "K2-122-135",
back = "#2196F3"
}
}
--[[ 组织行数据html ]]
for i = 1, #tabDataList do
strHtmlRow = strHtmlRow .. '' .. '
' ..
'
' .. tabDataList[i].code .. '
' ..
'
' .. '
' .. tabDataList[i].qd .. '
' ..
'
' .. tabDataList[i].zd .. '
' .. '
'
end
--[[ 总html ]]
local strHtml = ' ' .. '
' .. strHtmlTitle .. '
' ..
'
' .. strHtmlRow .. '
' .. '
'
local action = {}
action[1] = {
action_type = "chart",
value = {
graphicType = "html",
title = {
text = "当前入库任务",
align = "left",
color = "#fff",
font = "微软雅黑",
fontSize = 18
},
html = strHtmlStyle .. strHtml
}
}
-- lua.Debug( strLuaDEID, debug.getinfo(1), "action! ", action )
nRet, strRetInfo = mobox.setAction(strLuaDEID, lua.table2str(action))
if (nRet ~= 0) then
lua.Error(strLuaDEID, debug.getinfo(1), "setAction失败! " .. strRetInfo .. ' action = ' .. strAction)
end
end